Skip to content

feat(rollup-relayer): support codecv8 #1681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 26, 2025

Conversation

colinlyguo
Copy link
Member

@colinlyguo colinlyguo commented Jun 16, 2025

Purpose or design rationale of this PR

Enable rollup-relayer to support codecv8 and update bridge-history's da-codec commit for batch hash validation compatibility.

PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • feat: A new feature

Deployment tag versioning

Has tag in common/version.go been updated or have you added bump-version label to this PR?

  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change

Summary by CodeRabbit

  • New Features

    • Added support for codec version 8 in batch processing and relayer operations.
    • Introduced a new "feynmanTime" field in the proposer tool genesis configuration.
    • Added configuration parameters to limit maximum uncompressed batch byte size for chunk and batch proposers.
  • Improvements

    • Unified handling of codec versions 7 and 8 in relayer batch commit and finalize operations.
    • Enhanced batch and chunk proposal logic to enforce limits on uncompressed batch sizes.
    • Extended metrics to include uncompressed batch byte size measurements.
  • Tests

    • Added tests for uncompressed batch byte size limits for codec version 8 in chunk and batch proposers.
  • Chores

    • Updated several dependencies to their latest versions.
    • Bumped the application version to v4.5.25.

Copy link

coderabbitai bot commented Jun 16, 2025

Warning

Rate limit exceeded

@colinlyguo has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 26 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 64b583d and 3b9adb5.

⛔ Files ignored due to path filters (4)
  • bridge-history-api/go.sum is excluded by !**/*.sum
  • coordinator/go.sum is excluded by !**/*.sum
  • go.work.sum is excluded by !**/*.sum
  • rollup/go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • bridge-history-api/go.mod (1 hunks)
  • common/version/version.go (1 hunks)
  • coordinator/go.mod (1 hunks)
  • rollup/conf/config.json (1 hunks)
  • rollup/go.mod (1 hunks)
  • rollup/internal/controller/watcher/batch_proposer_test.go (7 hunks)
  • rollup/internal/controller/watcher/chunk_proposer_test.go (4 hunks)
  • rollup/proposer-tool-config.json (1 hunks)

"""

Walkthrough

This change updates dependency versions for several modules, increments the main version tag, adds support for codec version 8 in batch processing logic, and introduces a new configuration field in the proposer tool genesis JSON. Method signatures and logic in the relayer are adjusted to handle codec version 8 alongside version 7. Configuration and proposer components are enhanced to enforce a new uncompressed batch size limit with related metrics and tests updated accordingly.

Changes

File(s) Change Summary
bridge-history-api/go.mod
coordinator/go.mod
rollup/go.mod
Updated github.com/scroll-tech/da-codec and github.com/scroll-tech/go-ethereum dependency versions.
common/version/version.go Bumped version tag from "v4.5.24" to "v4.5.25".
coordinator/internal/logic/provertask/batch_prover_task.go Added support for codec version 8 in batch task detail processing.
rollup/internal/controller/relayer/l2_relayer.go Extended batch commit/finalize logic to handle codec V8 like V7; updated context ID and batch hash extraction logic; changed method signature to accept codec version.
rollup/proposer-tool-genesis.json Added new "feynmanTime" field to the config object.
rollup/conf/config.json Added max_uncompressed_batch_bytes_size parameter to chunk and batch proposer configs.
rollup/internal/config/l2.go Added MaxUncompressedBatchBytesSize field to ChunkProposerConfig and BatchProposerConfig structs.
rollup/internal/controller/watcher/batch_proposer.go Added checks for uncompressed batch byte size limit in batch proposal logic; updated logging and error messages.
rollup/internal/controller/watcher/chunk_proposer.go Added checks for uncompressed batch byte size limit in chunk proposal logic; updated logging and error messages.
rollup/internal/utils/utils.go Added L1CommitUncompressedBatchBytesSize metric to chunk and batch metrics; updated metric calculation functions.
rollup/internal/controller/watcher/batch_proposer_test.go
rollup/internal/controller/watcher/bundle_proposer_test.go
rollup/internal/controller/watcher/chunk_proposer_test.go
rollup/tests/rollup_test.go
Added MaxUncompressedBatchBytesSize parameter to proposer tests configuration.
rollup/proposer-tool-config.json Added max_uncompressed_batch_bytes_size parameter to chunk and batch proposer configs.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Layer2Relayer
    participant DB

    User->>Layer2Relayer: ProcessPendingBatches()
    Layer2Relayer->>Layer2Relayer: Determine codec version (V7 or V8)
    alt Codec V7 or V8
        Layer2Relayer->>Layer2Relayer: constructCommitBatchPayloadCodecV7()
        Layer2Relayer->>Layer2Relayer: contextIDFromBatches(codecVersion, batches)
    else Other versions
        Layer2Relayer->>Layer2Relayer: Handle accordingly
    end
    Layer2Relayer->>DB: SendTransaction(contextID)
    DB-->>Layer2Relayer: Transaction result
Loading

Possibly related PRs

Suggested reviewers

  • georgehao
  • jonastheis

Poem

A hop, a skip, a version jump,
New codecs land with quite a thump!
Genesis gains a "feynman" twist,
Relayers now know V8 exists.
With every merge, the code grows bright—
Rabbits cheer for changes right!
🐇✨
"""

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🔭 Outside diff range comments (1)
rollup/internal/controller/relayer/l2_relayer.go (1)

469-475: Method name & log message now misleading for V8 support

The switch correctly re-uses constructCommitBatchPayloadCodecV7 for both V7 and V8, but

  1. the helper’s name still ends in “CodecV7”;
  2. the error log hard-codes “…payload for V7”.

This will confuse future maintainers when troubleshooting V8 flows. Rename the helper (e.g. constructCommitBatchPayloadCodecV7V8) or introduce a thin wrapper for V8, and update the log message to reflect the actual codecVersion.

🧹 Nitpick comments (1)
rollup/proposer-tool-config.json (1)

4-8: Validate increased chunk proposer limits
Raising max_block_num_per_chunk to 1000 and max_l2_gas_per_chunk to 200000000000 can stress memory, database, and network layers. Confirm that the infrastructure and upstream components can handle these new limits without performance regressions.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d6b5a8 and 30153c1.

⛔ Files ignored due to path filters (4)
  • bridge-history-api/go.sum is excluded by !**/*.sum
  • coordinator/go.sum is excluded by !**/*.sum
  • go.work.sum is excluded by !**/*.sum
  • rollup/go.sum is excluded by !**/*.sum
📒 Files selected for processing (11)
  • bridge-history-api/go.mod (1 hunks)
  • common/version/version.go (1 hunks)
  • coordinator/go.mod (1 hunks)
  • coordinator/internal/logic/provertask/batch_prover_task.go (1 hunks)
  • coordinator/internal/types/prover.go (1 hunks)
  • rollup/docker-compose-proposer-tool.yml (1 hunks)
  • rollup/go.mod (1 hunks)
  • rollup/internal/controller/relayer/l2_relayer.go (4 hunks)
  • rollup/internal/controller/watcher/proposer_tool.go (1 hunks)
  • rollup/proposer-tool-config.json (1 hunks)
  • rollup/proposer-tool-genesis.json (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
rollup/internal/controller/relayer/l2_relayer.go (1)
rollup/internal/orm/batch.go (2)
  • Batch (22-72)
  • Batch (80-82)
🔇 Additional comments (10)
common/version/version.go (1)

8-8: Version tag bumped correctly.

The patch version was incremented to v4.5.22 in line with the updated da-codec and go-ethereum dependencies across modules.

rollup/internal/controller/watcher/proposer_tool.go (1)

1-162: No logic changes detected.

This PR only reorders the import of scroll-tech/database/migrate; functionality remains unchanged.

rollup/go.mod (1)

14-15: Ensure consistency of dependency versions across modules.

Please verify that the updated da-codec and go-ethereum commit hashes here match exactly in coordinator/go.mod and bridge-history-api/go.mod to avoid build mismatches.

Run:

#!/bin/bash
rg "github.com/scroll-tech/da-codec v0.1.3-0.20250616065246-17bf3e4990cd" -l
rg "github.com/scroll-tech/go-ethereum v1.10.14-0.20250611141528-cf3d22ef8707" -l
coordinator/go.mod (1)

12-13: Align dependency versions with other modules.

The da-codec and go-ethereum versions were bumped here; confirm they are identical to those in rollup/go.mod and bridge-history-api/go.mod to maintain cross-module compatibility.

bridge-history-api/go.mod (2)

13-14: Verify updated require directives.

The da-codec and go-ethereum versions have been upgraded; ensure these commits align with those in the rollup and coordinator modules.


21-21: Confirm hotfix coverage in replace directive.

The replace directive for go-ethereum points to commit 20250616074821-cba908db071d with a note about a header hash hotfix. Please verify that this commit indeed contains the intended fix.

coordinator/internal/types/prover.go (1)

3-7: No functional changes detected
The blank line added between the "fmt" and "scroll-tech/common/types/message" imports is purely stylistic and does not affect behavior.

rollup/docker-compose-proposer-tool.yml (1)

30-32: Verify updated --start-l2-block value
Ensure that the new block number "14907015" correctly aligns with the intended activation point for CODEC V8 support and that no downstream tooling assumes the old start height.

rollup/proposer-tool-genesis.json (1)

8-11: Ensure feynmanTime field is utilized
The new "feynmanTime": 0 field has been added to the genesis config. Verify that the proposer‐tool code actually reads and applies this parameter, otherwise it may be silently ignored.

coordinator/internal/logic/provertask/batch_prover_task.go (1)

267-272: Extend batch codec support to V8
Incorporating encoding.CodecV8 alongside existing versions is correct. Please ensure you have added or updated unit/integration tests to cover the new V8 decoding path and validate backward compatibility.

@colinlyguo colinlyguo force-pushed the feat-rollup-relayer-support-codecv8 branch from 30153c1 to 377e8bb Compare June 16, 2025 10:26
@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2025

Codecov Report

Attention: Patch coverage is 69.56522% with 7 lines in your changes missing coverage. Please review.

Project coverage is 40.11%. Comparing base (9367565) to head (3b9adb5).

Files with missing lines Patch % Lines
rollup/internal/controller/relayer/l2_relayer.go 75.00% 1 Missing and 1 partial ⚠️
...llup/internal/controller/watcher/batch_proposer.go 71.42% 2 Missing ⚠️
rollup/internal/utils/utils.go 0.00% 2 Missing ⚠️
...tor/internal/logic/provertask/batch_prover_task.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1681      +/-   ##
===========================================
- Coverage    40.15%   40.11%   -0.05%     
===========================================
  Files          234      234              
  Lines        18614    18618       +4     
===========================================
- Hits          7474     7468       -6     
- Misses       10409    10423      +14     
+ Partials       731      727       -4     
Flag Coverage Δ
bridge-history-api 8.14% <ø> (ø)
coordinator 34.47% <0.00%> (-0.29%) ⬇️
rollup 46.33% <72.72%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

georgehao
georgehao previously approved these changes Jun 18, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
rollup/internal/controller/relayer/l2_relayer.go (1)

468-476: Minor log message mismatch after Codec V8 support
The error log inside the new switch block is hard-coded to “for V7”, which is misleading when codecVersion is V8.

-            log.Error("failed to construct constructCommitBatchPayloadCodecV7 payload for V7", "codecVersion", codecVersion, ...
+            log.Error("failed to construct commitBatch payload", "codecVersion", codecVersion, ...

Purely cosmetic, but worth adjusting to avoid confusion when debugging.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60a2280 and 8f44dc9.

📒 Files selected for processing (1)
  • rollup/internal/controller/relayer/l2_relayer.go (4 hunks)
🧰 Additional context used
🪛 golangci-lint (1.64.8)
rollup/internal/controller/relayer/l2_relayer.go

525-525: undefined: dbBatchWithChunksAndParent

(typecheck)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: check
  • GitHub Check: tests
  • GitHub Check: test
  • GitHub Check: check
  • GitHub Check: tests
🔇 Additional comments (1)
rollup/internal/controller/relayer/l2_relayer.go (1)

534-537: Future-proof parsing LGTM
The generalized batchHashesFromContextID correctly handles any v<N>-… prefix and gracefully falls back. Nice improvement over the old fixed-version check.

@colinlyguo colinlyguo force-pushed the feat-rollup-relayer-support-codecv8 branch from e5a75c7 to d274123 Compare June 18, 2025 15:22
@colinlyguo colinlyguo added the bump-version Bump the version tag for deployment label Jun 22, 2025
@colinlyguo colinlyguo force-pushed the feat-rollup-relayer-support-codecv8 branch from 10a5802 to c3eafe5 Compare June 23, 2025 17:11
@colinlyguo colinlyguo force-pushed the feat-rollup-relayer-support-codecv8 branch 2 times, most recently from 64b583d to 5c5ab15 Compare June 26, 2025 11:56
@colinlyguo colinlyguo force-pushed the feat-rollup-relayer-support-codecv8 branch from 5c5ab15 to f60c290 Compare June 26, 2025 11:59
@yiweichi yiweichi self-requested a review June 26, 2025 13:08
@georgehao georgehao merged commit 9dc57c6 into develop Jun 26, 2025
12 checks passed
@georgehao georgehao deleted the feat-rollup-relayer-support-codecv8 branch June 26, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump-version Bump the version tag for deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants